package com.bawei.park2302.adapter

import android.database.DatabaseUtils
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding
import com.bawei.lib_base.utils.utils.entity.NoticeBeanItem
import com.bawei.park2302.R
import com.bawei.park2302.databinding.ItemNoticeBinding
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

class NoticeAdapter : BaseQuickAdapter<NoticeBeanItem,BaseViewHolder>(R.layout.item_notice){
    override fun onItemViewHolderCreated(viewHolder: BaseViewHolder, viewType: Int) {
        super.onItemViewHolderCreated(viewHolder, viewType)
        DataBindingUtil.bind<ItemNoticeBinding>(viewHolder.itemView)
    }

    override fun convert(helper: BaseViewHolder, item: NoticeBeanItem) {
        val binding = DataBindingUtil.getBinding<ItemNoticeBinding>(helper.itemView)!!
        binding.bean = item
    }
}